$(document).ready(function(){
	var label= $('.jpserver');
	var content= $('.content');
	/*$('.content').not(":first").hide();*/
	$('.content').hide();
	$('.jpserver').on("click",function(){
		var labelClicked = $(this);
		var labelContent = labelClicked.parent().next();
		if(labelContent.is(":visible")) {
			return;
		}
		content.slideUp("normal");
		labelContent.slideDown("slow");
	});
});
/* 确认按钮 */
function confirmd() {
	var msg = "您真的确定要删除吗？  \n请确认！";
	if (confirm(msg) == true) {
		return true;
	} else {
		return false;
	}
};

/* 确认备份 */
function backup(feignName) {
	var msg = "您确定要备份"+feignName+"微服务吗？  \n请确认！";
	if (confirm(msg) == true) {
		return true;
	} else {
		return false;
	}
};

/* 确认还原 */
function restore(feignName) {
	var msg = "您确定要还原"+feignName+"微服务吗？  \n请确认！";
	if (confirm(msg) == true) {
		return true;
	} else {
		return false;
	}
};

/* 异步注销实例 */
function deleteInstance(server,instanceId) {
	debugger;
	$.get("/"+server+"/instancesId/"+instanceId, function(data) {
			history.go(0); 
		} 
	);
	history.go(0); 
}

/* 异步备份实例   */
function backupInstance(feignName) {
	debugger;
	$.get("/oracle/backup/"+feignName, function(data,status) {
		alert("备份的版本为: " + data + "\nStatus: " + status);
		history.go(0);
		} 
	);
	alert("正在备份!")
	history.go(0); 
}

/* 异步还原实例 */
function restoreInstance(vname) {
	debugger;
	$.get("/oracle/restore/"+vname, function(data) {
		alert("还原的版本为: " + data );
		history.go(0); 
		} 
	);
	alert("正在还原!")
	history.go(0); 
}
